package com.liunian.subject.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum SubjectTypeEnum {

    RADIO(1, "单选"),
    MULTIPLE(2,"多选"),
    JUDGE(3, "判断"),
    BRIEF(4, "简答")
    ;

    private final Integer code;
    private final String desc;

    public static SubjectTypeEnum getByCode(int code) {
        for (SubjectTypeEnum value : SubjectTypeEnum.values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }

}
